<%@ page language="java" contentType="text/html;charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jstl/core_rt"%>

<!DOCTYPE HTML>

<html>
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>로그인</title>
<link href="<%=request.getContextPath()%>/view/css/user/login.css" rel="stylesheet">
<link href="<%=request.getContextPath()%>/view/css/user/signup.css" rel="stylesheet">
<link href="<%=request.getContextPath()%>/view/css/user/forgot.css" rel="stylesheet">
<link href="<%=request.getContextPath()%>/view/css/user/message.css" rel="stylesheet">
<script src="<%=request.getContextPath()%>/view/js/jquery-1.11.1.min.js"></script>
</head>
<body>
	<div id="wraplogin">
		<div id="wraplogintop"></div>
		<div id="wraploginmiddle">
			<h2>로그인</h2><br/>
			<form id="login_form" action="<%=request.getContextPath()%>/user/login.action" method="post">
				<input type="email" name="account" id="login_account" placeholder="계정(Email)" required autofocus><br/>
				<input type="password" name="password" id="login_password" placeholder="비밀번호" required><br/>
				<input type="submit" id="login_submit" value="로그인">
			</form>
			<span id="forgot">비밀번호 찾기</span><span id="signup">가입하기</span>
		</div>
		<div id="wraploginbottom"></div>
	</div>
	<div id="wrapadd">
		<c:if test="${!empty message}">
			<div id="wraploginmsg">${message}</div>
		</c:if>
	</div>
	
	<script>
		$('#forgot').click(function() {
			$.ajax({
				url : 'forgot.action',
				type : 'POST',
				dataType : 'html',
				success : function(html) {
					$('#wrapadd').html(html);
				},
				error : function(xhr, ajaxOptions, thrownError) {
					alert('An error occurred! ' + thrownError);
				},
			});
		});
		
		$('#signup').click(function() {
			$.ajax({
				url : 'signup.action',
				type : 'POST',
				dataType : 'html',
				success : function(html) {
					$('#wrapadd').html(html);
				},
				error : function(xhr, ajaxOptions, thrownError) {
					alert('An error occurred! ' + thrownError);
				},
			});
		});
	</script>
</body>
</html>